<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

use app\common\model\WalletRechargeType;

/**
 * CurrencyPay控制器
 */
class CurrencyPay extends AdminBase
{
    
    /**
     * CurrencyPay列表
     */
    public function CurrencyPayList()
    {
        
        $where = $this->logicCurrencyPay->getWhere($this->param);
        
        $this->assign('list', $this->logicCurrencyPay->getWalletRechargeTypeList($where, 'a.*', 'a.create_time desc'));
        
        return $this->fetch('currencypaylist');
    }
    
    /**
     * CurrencyPay添加
     */
    public function CurrencyPayAdd()
    {

        $this->CurrencyPayCommon();
        $info = \app\common\model\Wallet::all(['is_virtual'=>1,'is_currency'=>1]);

        $this->assign('list', $info);
        return $this->fetch('currencypay_edit');
    }
    
    /**
     * CurrencyPay编辑
     */
    public function CurrencyPayEdit()
    {
        
        $this->CurrencyPayCommon();
        
        $info = WalletRechargeType::get(['id'=>$this->param['id']]);

        $this->assign('list', \app\common\model\Wallet::all(['is_virtual'=>1,'is_currency'=>1]));
        $this->assign('info', $info);
        
        return $this->fetch('currencypay_edit');
    }
    
    /**
     * CurrencyPay添加与编辑通用方法
     */
    public function CurrencyPayCommon()
    {

        IS_POST && $this->jump($this->logicCurrencyPay->CurrencyPayEdit($this->param));

    }
    


    
    /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('WalletRechargeType', $this->param));
    }
}
